﻿using IR.Controller.ModelControllers;
using IR.WPF.ViewModels.LandingViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IR.WPF.UI.ViewModels
{
    public class VMVersionHeader : ViewModelBase
    {
        private VMVersion[] _versions = new VMVersion[0];

        public VMVersion[] Versions
        {
            get
            {
                //Make this async
                _versions = CVersion.QueryVersions(null)
                    .OrderByDescending(cv => cv.DateCreated)
                    .Select(version => new VMVersion(version))
                    .ToArray();

                return _versions;
            }
        }
    }
}
